package org.sgsm.dungeon.generator.method;

import java.io.PrintWriter;

import org.sgsm.dungeon.generator.ObjectType;

public abstract class MethodCRUD extends Method
{

  public MethodCRUD()
  {
    super();
  }

  public abstract void generateServiceImpl();

  public abstract void generateName(String pPack, String pName);

  public String getSignature()
  {
    String result = "public ";
    result += _ObjetOut.getName() + " " + _MethodName + "(";
    int taille = _ObjetIn.size();
    for (int i = 0; i < taille; i++)
    {
      if (i != 0)
      {
        result += " , ";
      }
      result += _ObjetIn.get(i).getName() + " p" + _ObjetIn.get(i).getName();
    }
    return result + ")";
  }

  public ObjectType getContext()
  {
    return new ObjectType("org.sgsm.dungeon.xsd.context", "ContextType");
  }

  public void setOut(PrintWriter pOut)
  {
    _out = pOut;
  }
  
  public String getBean()
  {
    return getObjetIn().get(0).getName();
  }
}
